{if $full_page}
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{$title}</title>
<link rel="stylesheet" href="Res/boot/css/bootstrap.min.css" type="text/css" media="screen" />
<link rel="stylesheet" href="Res/boot/css/bootstrap-theme.min.css" type="text/css" media="screen" />
<script type="text/javascript" src="Res/js/jquery-1.11.3.min.js"></script>
<script type="text/javascript" src="Res/js/jquery.cookie.js"></script>
<script type="text/javascript" src="Res/boot/js/bootstrap.min.js"></script>
<script type="text/javascript" src="Res/js/listTable.js"></script>
<link rel="stylesheet" href="Res/css/page.css" type="text/css" />
<link rel="stylesheet" href="Res/css/global.css" type="text/css" />
{literal}
<style>
    .listDiv{margin:0 auto;}  
    table tbody td lable:hover{background-color:#00E8D7}
</style>
{/literal}
</head>
<body>
<div class="container-fluid">
	<div class="row-fluid">
            <div class="span12 panel panel-info">                
                <span class="cp_title">{$title}</span>
                <div class="add_cp">
                        <a href="index.php?c={$class}&m=create">+添加内容</a>
                </div>
                <div class="panel-heading controls">
                    <label for="action_code">包含的内容:</label>
                    <input class="input-medium search-query" id="content" name="content" type="text" placeholder="包含的内容" />   
                    <label for="action_code">回复的ID:</label>
                    <input class="input-medium search-query" id="replyid" name="replyid" type="text" placeholder="回复的ID" />
                    <select id="tid" name="tid" style="width: 102px;height: 26px">
                        <option value="-1">选择标题</option>
                        {foreach from=$titledata item=row}
                            {if $cookie.tid == $row.tid}
                                <option value="{$row.tid}" selected="true">{$row.tname}</option>        
                            {else}
                                <option value="{$row.tid}">{$row.tname}</option>
                            {/if}                    
                        {/foreach}
                    </select>
                    <button type="button" id="btn_search" class="btn btn-success">查找</button>                        
                </div>
 
                <div class="listDiv" id="listDiv">
{/if}
                <table id="data_table_id" class="table table-hover table-bordered">
                    <thead>
                    <tr>                        
                        <th><a href="javascript:listTable.sort('cid', 'DESC');" title="点击对列表排序">ID</a>{$sort_cid}</th>
                        <th>主题名称</th>
                        <th><a href="javascript:listTable.sort('replyid', 'DESC');" title="点击对列表排序">回复ID</a>{$sort_replyid}</th>
                        <th>内容简述</th>
                        <th>显示状态</th>
                        <th>原贴URL</th>
                        <th><a href="javascript:listTable.sort('floor', 'DESC');" title="点击对列表排序">楼层</a>{$sort_floor}</th>
                        <th><a href="javascript:listTable.sort('restime', 'DESC');" title="点击对列表排序">回贴时间</a>{$sort_restime}</th>
                        <th><a href="javascript:listTable.sort('in_time', 'DESC');" title="点击对列表排序">加入时间</a>{$sort_in_time}</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>    
                        {foreach from=$data.pageData item=row}
                        <tr>
                            <td>{$row.id}</td>
                            <td>{$row.tname}</td>
                            <td>{$row.replyid}</td>
                            <td>{$row.content}</td>                            
                            <td style="text-align:center;">
                                <span class="glyphicon {$row.is_show}" style="cursor:pointer;font-size: 16px;line-height: 28px;" 
                                      onclick="listTable.toggle(this,{$row.cid}, 'is_show')"></span>
                            </td>
                            <td>{$row.ori_url}</td>
                            <td>{$row.floor}楼</td>
                            <td>{$row.restime_format}</td>
                            <td>{$row.in_time_format}</td>
                            <td style="text-align:center;">
                                <button class="btn btn-info" type="button" onclick="edit({$row.cid})">
                                    <span class="glyphicon glyphicon-pencil"></span>
                                </button>
                                <button class="btn btn-info" type="button" onclick="listTable.remove({$row.cid}, '真的需要删除吗？删除后可到回收站恢复！')">
                                    <span class="glyphicon glyphicon-trash"></span>
                                </button>
                            </td>
                        </tr>
                        {foreachelse}
                        <tr class="text-center" style="color:grey;">
                            <td colspan="8">无数据</td>
                        </tr>
                        {/foreach}
                    </tbody>
                    {if $data.pageData}
                    <tfoot>
                        <!-- 分页数据 -->
                        <tr>
                            <td colspan="10"><div class="iPageHtml">{$data.pageHtml}</div></td>
                        </tr>
                    </tfoot>
                    {/if}
                </table>
{if $full_page}
                </div>
            </div>
	</div>
</div>
<div style="clear:both;"></div>
{literal}
<script type="text/javascript">
    listTable.m = 'query';
    listTable.divid = 'listDiv';
    $("#btn_search").click(function(){
        listTable.filter['page'] =1;
        listTable.filter['tid'] = $("#tid option:selected").val();
        listTable.filter['replyid'] = $("#replyid").val();
        listTable.filter['content'] = $("#content").val();
        listTable.loadList();
    });
    function edit(id) {
        window.location.href = 'index.php?c=storycontent&m=edit&id=' + id;
    }
</script>
{/literal}
</body>
</html>
{/if}